{extend name="public/base"/}
{block name="style"}
<script src="/public/lboyue/js/book.js"></script>
<script src="/public/lboyue/js/libs/jquery.cookie.js"></script>
<script src="/public/lboyue/js/libs/jquerybase64.js"></script>
{/block}
{block name="body"}
{include file="public/header" /}
<div class="bodySection">
    <div class="window_mothWindow" id="mothWindow" style="display: none;">
        <div class="title">投月票</div>

        <!--  没有月票 -->
        <div class="content"  style="display: none;" id="nopiao">
            <span class="notPiao">
                没有月票了
            </span>
            <span style="font-size: 12px; text-align: center;width: 100%;">获取月票方式说明：<i style="color: #ea4136">每充值10元即可获得1张月票</i>，多充多送</span>
            <div class="buttonList">
                <span class="button active" onclick="gopay()">去充值</span>
                <input type="hidden" id="reurl" value="">
                <span class="button cancel">关闭</span>
            </div>
        </div>

        <!--  有月票 -->
        <div class="content" id="youpiao">
            <span class="havePiao" id="voteNum">
                你有<i id="yuepiaonum">5</i>张月票可用
            </span>
            <div class="toupiao">
                <div class="rewardBlock_addBlock" style="width: 180px; margin: 0 auto 0 165px;">
                    <span class="span_li">投票数量：</span>
                    <span class="span_li reduce"  id="reduceButton"></span>
                    <span class="span_li input"><input type="number" min="1" value="1" id="myVote"></span>
                    <span class="span_li add"  id="addButton"></span>
                    <input type="hidden" value="0" >
                </div>
            </div>
            <div class="buttonList">
                <span class="button active" onclick="sendyuepiao(1)">确定</span>
                <span class="button cancel">不投了</span>
            </div>
        </div>
    </div>

    <!--  投票成功 -->
    <div class="tips_alert"  id="delete_alert"  style="display: none">
        <span>投票成功！</span>
    </div>
    
    <div class="replyWindow"  id="commentuser" style="display: none"></div>

    <div class="window_mesk" style="display: none"></div>

    <div class="centerSection">
        <div class="navigationSection">
            当前位置：<a href="/">{:config('web_site_title')}</a> > <a href="/books/">书库</a> >{$title}（书号：{$id}）
        </div>
        <div class="detailSection">
            <div class="detailSection_left">
                <div class="detailSection_leftTitle">
                    <div class="statePos">
						{if $fullflag==1}<i class="end"></i>{else}<i class="serialized"></i>{/if}
                    </div>
                    <div class="detailSection_leftTitle_cons">
                        <div class="detailSection_h1">
                            <h1>{$title}</h1>
                            <span class="bookDetail">总点击：{$allvisit} | {$size}字 |  最新更新：{$lastvolume} {$update_time|date='Y-m-d',###}</span>
                        </div>

                        <div class="detailSection_rightBlock">
                            <div class="button">{$allvisit/100|round}人在追</div>
                        </div>
                        <div class="detailSection_qianyue"></div>
                    </div>
                </div>


                <div class="detailSection_stream">
				
                    <div class="detailSection_streamLeft">
                        <img src="{$cover}" alt="" onerror="javascript:this.src='/public/novel/images/default.jpg';"/>
						<!---	
                        <div class="detailSection_streamPiao">
                            <span class="piaoNum" id="yuepiao">552</span>
                            <span class="piaoNum_2">张</span>
                            <span class="piaoNum_2">月</span>
                            <span class="piaoNum_2">票</span>
                            <span class="zanutton" onclick="openyuepiao(1)">投</span>
                        </div>

                        <div class="detailSection_opens">当月月票榜排名0</div>
						--->

                    </div>

                    <div class="detailSection_streamRight">
                        <div class="detailSection_streamRightCons">
                             <span class="content">
                                {$intro}</span>

                                <span class="labelBlock">
                                     <i class="labelBlock_title">标签：</i>
                                     <span class="labelBlock_list">
                                         {$keywords}
                                     </span>
                                 </span>
                            
                            <div class="buttonList">
								
								{empty name="bookcase"}
									<div class="button" onclick="addbookshelf({$bookid},{$previd}, 2, '{$Think.config.web_pc_url|str_replace="http://www","",###}')" onselectstart="return false;">加入书架</div>
								{else /}
									<div class="button" style="border: 1px solid #ea4136;" onselectstart="return false;">已加入书架</div>
								{/empty}
                                
                                <div class="button" onclick="chapterlist({$bookid})" onselectstart="return false;">书籍目录</div>
                                <div class="button"  id="showWindow" onselectstart="return false;" style="cursor: default">
                                    手机阅读
									<div class="wx_code wx_code2" id="codeWindow" style="display: none;0"><div class="wx_code_block" style=""><i class="arrow"></i><span class="title3">关注微信公众账号</span><img src="{:config('agent_qzgzewm')}" alt="" /><span class="tips">请用微信扫描二维码关注公众账号<br/>后输入”{$id}”继续阅读精彩内容</span></div><div class="wx_code_block" style=""><i class="arrow"></i><span class="title3">手机浏览器扫码阅读</span><img src="/pay/qrcode?q={$bookmobileurl|urlencode}&width=8" alt="" /><span class="tips">请在手机浏览器中扫描上<br/>面的二维码，直接手机阅读<br/>登录”{:config('web_site_title')}”</span></div></div>
                                </div>
                                <div class="button active" onclick="readbook({$bookid}, {$previd})" onselectstart="return false;">立即阅读</div>
                            </div>

                        </div>

                    </div>

                </div>
                <div class="newPageSection">
                    <a href="/chapter/read/{$bookid}/{$chapter.id}">
                    <div class="newPageSectionBlock">
                         <span class="title">
                             {$chapter.chaptername} >>
                             <i>{$chapter.update_time|date="Y-m-d H:i:s",###}</i>
                         </span>
                        <span class="content">
                             &nbsp;&nbsp;&nbsp;&nbsp;{$chapter.content}。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;此情此景...                         </span>
                    </div>
                    </a>
                </div>
                
                <div class="rewardBlock">
                    <div class="rewardBlock_title">
                        <div class="h1">打赏</div>
                        <div class="nav">
                            <ul>
                                <li class="last"><i></i>知音难求</li>
								<li class="last"><i></i>小有名气</li>
								<li class="last"><i></i>众望所归</li>
								<li class="last"><i></i>名震四海</li>
								<li class="last"><i></i>独孤求败</li>
                            </ul>
                        </div>
                    </div>

                    <div class="rewardBlock_cons" >
                        <div class="rewardBlock_consLeft" id="gift">
							<div class="noDataText3">
                                    你还没有打赏过作者呢, 现在就<br>
                                    去打赏作者助Ta提升名气吧～
                            </div>
                        </div>


                        <div class="rewardBlock_consRight">
                            <div class="rewardBlock_consRightBlock">
                                <ul>
									{volist name="bonusconfig" id="vo"}
                                    <li>
                                        <div class="rewardBlock_top">
											<div class="active"><i></i></div>
											<img src="{$vo.imgfile}" alt="">
										</div>
										<div class="rewardBlock_bottom">
											<span class="name" sendwords="{$vo.desc}">{$vo.caption}</span>
											<span class="money"><i>{$vo.price}</i>书币/艘</span>
										</div>
										<input type="hidden" class="giftid" value="{$vo.name}">
									</li>
									{/volist}
                                </ul>
                            </div>

                            <div class="rewardBlock_addBlock">
                                <span class="span_li">数量：</span>
                                <span class="span_li reduce" id="reduce"></span>
                                <span class="span_li input"><input type="number" min="1" value="0"  id="productNum"/></span>
                                <span class="span_li add" id="add"></span>
                                <span class="span_li">共<i id="allMoney">0</i>书币</span>
                                <input type="hidden" value="0" id="moneyType">
                            </div>
                            <input type="hidden" id="giftid" value="">
                            <div class="rewardBlock_main">
                                <span class="title">赠言：</span>
                                <div class="rewardBlock_mainText">
                                    <textarea name="" id="message" cols="30" rows="10" placeholder="支持作者文思泉涌，妙笔生花"></textarea>
                                </div>
                                <div class="button" onclick="sendgift({$bookid})">打赏</div>
                            </div>

                        </div>

                    </div>

                </div>


                <div class="commentSection">

                    <div class="commentSection_title">
                        <span class="title"><i class="big">评论</i>(共{$review_count}条)  <i class="tips">书评文明上网理性发言，请遵守本站评论规范</i></span>
                    </div>

                    <div class="commentSection_textarea">
                        <textarea name="comment"  cols="30" rows="10" placeholder="评论《{$title}》" id="comment" onKeyDown="textCounter(comment,fontcnt,100);"  onKeyUp="textCounter(comment,fontcnt,100);"></textarea>
                    </div>


                    <div class="commentSection_biaoQing">

                        <div class="commentSection_biaoQing_left">
                            <span  onclick="closeicon(1)">表情</span>
                            <div class="commentSection_faceSelect">
                                <i class="arrow"></i>
                                <div class="commentSection_list">
                                    <ul>
                                                                                <li onclick="selectFace('[faceico_1]')"><img src="/public/lboyue/images/face/faceico_1.png" /></li>
                                                                                <li onclick="selectFace('[faceico_2]')"><img src="/public/lboyue/images/face/faceico_2.png" /></li>
                                                                                <li onclick="selectFace('[faceico_3]')"><img src="/public/lboyue/images/face/faceico_3.png" /></li>
                                                                                <li onclick="selectFace('[faceico_4]')"><img src="/public/lboyue/images/face/faceico_4.png" /></li>
                                                                                <li onclick="selectFace('[faceico_5]')"><img src="/public/lboyue/images/face/faceico_5.png" /></li>
                                                                                <li onclick="selectFace('[faceico_6]')"><img src="/public/lboyue/images/face/faceico_6.png" /></li>
                                                                                <li onclick="selectFace('[faceico_7]')"><img src="/public/lboyue/images/face/faceico_7.png" /></li>
                                                                                <li onclick="selectFace('[faceico_8]')"><img src="/public/lboyue/images/face/faceico_8.png" /></li>
                                                                                <li onclick="selectFace('[faceico_9]')"><img src="/public/lboyue/images/face/faceico_9.png" /></li>
                                                                                <li onclick="selectFace('[faceico_10]')"><img src="/public/lboyue/images/face/faceico_10.png" /></li>
                                                                                <li onclick="selectFace('[faceico_11]')"><img src="/public/lboyue/images/face/faceico_11.png" /></li>
                                                                                <li onclick="selectFace('[faceico_12]')"><img src="/public/lboyue/images/face/faceico_12.png" /></li>
                                                                                <li onclick="selectFace('[faceico_13]')"><img src="/public/lboyue/images/face/faceico_13.png" /></li>
                                                                                <li onclick="selectFace('[faceico_14]')"><img src="/public/lboyue/images/face/faceico_14.png" /></li>
                                                                                <li onclick="selectFace('[faceico_15]')"><img src="/public/lboyue/images/face/faceico_15.png" /></li>
                                                                                <li onclick="selectFace('[faceico_16]')"><img src="/public/lboyue/images/face/faceico_16.png" /></li>
                                                                                <li onclick="selectFace('[faceico_17]')"><img src="/public/lboyue/images/face/faceico_17.png" /></li>
                                                                                <li onclick="selectFace('[faceico_18]')"><img src="/public/lboyue/images/face/faceico_18.png" /></li>
                                                                                <li onclick="selectFace('[faceico_19]')"><img src="/public/lboyue/images/face/faceico_19.png" /></li>
                                                                                <li onclick="selectFace('[faceico_20]')"><img src="/public/lboyue/images/face/faceico_20.png" /></li>
                                                                            </ul>
                                </div>
                            </div>
                        </div>

                        <div class="commentSection_biaoQing_right">
                            <span class="font" id="fontcnt">还能输入100字</span>
                            <div class="submit" onclick="addcomment({$bookid}, 0, 0)"  onselectstart="return false;">评论</div>
                        </div>

                    </div>

                    <div class="commentSection_userComment">
                        <div class="userCommentList" style="min-height: 290px;">
                            <ul id="commenthtml">
							   {volist name="review" id="vo"}
                               <li><div class="leftFace"><img src="{$vo.avatar}" alt=""><span class="name">{$vo.username}</span></div><div class="rightContent"><div class="replyContent">{$vo.content|reviewcontent_replace}</div><div class="replyBottom"><div class="leftBlock">{$vo.create_time}</div><div class="rightBlock"><span class="heart {if $vo['goodnum']>0}heart_active{/if}" onclick="addzan({$vo.id})" id="zan_{$vo.id}"><i></i>({$vo.goodnum}) </span><span class="replyNum"><i>|</i><a onclick="commentuser({$bookid}, {$vo.id}, 0)">回复</a></span></div></div></div></li>
							   {/volist}
							</ul>
                        </div>
                            
                    </div>
                </div>

            </div>

            <div class="detailSection_right">
                <div class="detailSection_userSection">
                    <span class="detailSection_faceBlock">
                        <span class="face"><img src="{$works_author}"  onerror="javascript:this.src='/public/lboyue/images/noData/avatar.png';"/></span>
                        <span class="name">{$author}</span>
                        <div class="content">
                            我是资深小扑街。                        </div>
                    </span>
                    <div class="detailSection_userMessage">

                        <div class="lisBlock">
                            <span class="icon"><img src="/public/lboyue/images/zuopin.png"  /></span>
                            <span class="name">作品总数</span>
                            <span class="num">{$works_count}</span>
                        </div>

                        <div class="lisBlock">
                            <span class="icon"><img src="/public/lboyue/images/leiji.png"  /></span>
                            <span class="name">累计字数</span>
                            <span class="num">{$workssize_count}万</span>
                        </div>

                        <div class="lisBlock  last_lisBlock">
                            <span class="icon"><img src="/public/lboyue/images/chuangzuo.png"  /></span>
                            <span class="name">创作天数</span>
                            <span class="num">{$works_days}</span>
                        </div>

                    </div>

                    <div class="detailSection_other">
                        <div class="title">
                            <span>其他作品</span>
                        </div>
                        <div class="list">
                            <ul>
								{volist name="works_list" id="vo"}
                                <li>
                                        <a href="{:url('book/info',['id'=>$vo.id])}">
                                            <span class="left"><img src="{$vo.cover}" alt="" /></span>
                                            <span class="content">
                                                <i>{$vo.title}</i>
                                                <i>作者：{$vo.author}</i>
                                            </span>
                                        </a>
                                    </li>
								{/volist}                         </ul>
                        </div>
                    </div>

                </div>
                

                <div class="bannerSection_right" style="margin-top: 20px;clear: both; float: none;">
                    <div class="section_title" id="cetest">本周推荐</div>
                    <div class="section_panxing">
                        <ul>
							{list name="novel" id="item" limit="4" map=" status=1 and display=1 and FIND_IN_SET(9,is_top)"}
                            <li>
							<a href="{:url('/book/info',array("id"=>$item.id))}">
								<div class="section_titleSpan" {if $key==0}style="display: none;"{else}style="display: block;"{/if}>
									<span class="num">{$key+1}</span>
									<span class="font">{$item.title}</span>
									<span class="lookNum"></span>
								</div>
								<div class="section_bigBlock  first_bigBlock" {if $key==0}style="display: block;"{else}style="display: none;"{/if}>
									<span class="num"><i>{$key+1}</i></span>
									<span class="img"><img src="{$item.cover}" alt="" onerror="javascript:this.src='/public/novel/images/default.jpg';"/></span>
									<span class="content">
										<span class="title">{$item.title}</span>
										<i>作者: {$item.author}</i>
										<i>类型: {$item.category_id| get_category=###,'title'}</i>
									</span>
								</div>
							</a>
						</li>
								{/list}
                        </ul>
                    </div>
                    <div class="section_panxingMore"><a href="/top/">查看更多</a></div>
                </div>

                <div class="tipsSection">
                    <div class="section_title">温馨提示</div>
                    <div class="tipsSection_cons">
                        《{$title}》为作者{$author}所著虚构作品，不涉及任何真实人物、事件等，请勿将杜撰作品与现实挂钩。此作品为作者所著原创作品，更新最快最给力，欢迎各位进行正版阅读。本故事内容纯属虚构，如有雷同，纯属巧合，请勿模仿。{:config('web_site_title')}支持第三方一键登录，包括腾讯QQ、新浪微博、百度贴吧，实现极简登录体验。登录后可发言、投票、追书、打赏等。
                    </div>
                </div>


            </div>

        </div>
    </div>
</div>

{block name="include"}{include file="public:footer" /}{/block}    
{/block}
{block name="script"}
    <script type="text/javascript">
        $(document).ready(function () {
            selectGift();
            clickAdd();
            clickReduce();
            showCodeWindow();
            showFace();
            voteFun();
            closeVote();
            bindrankstyle();
            $(".closeBtn").click(function () {
                $(".replyWindow").hide();
                $(".window_mesk").hide();
            });
            liactive("navpages", "books", "a", "");
            bindblurcheck();
            bindblurgift();


        });

        //用户评论用户表情显示
        function usercommentuserface() {
            $(".commentSection_biaoQing_left2").find('.commentSection_faceSelect2').fadeIn(200);
        }

    </script>
<script>
    $(document).ready(function () {
        bindnews();
        bindbookshelf();
        bindnav();
		
		var bookid = {$bookid};
		var total = {$sumbonus|default=0};
		$.ajax({
			url      : "/book/ajaxbonus",
			type     : "post",
			dataType : "json",
			data     :{'bookid':bookid},
			success  : function (json) {
				if (json.lists.length>0)
				{
					var html='';
					html += '<ul>';
                    $.each(json.lists, function(i, v) { 
						html += '<li>';
                        html += '<span class="left">'+v.authorname+'</span>';
                        html += '<span class="right">送了<i>'+v.num+'艘</i>'+v.actname+'</span>';
                        html += '</li>';
					})
                    html += '</ul>';
                    html += '<div class="rewardBlock_sbottom">累计打赏: '+total+'</div>';
					console.log(html);
                    $("#gift").html(html);
				}

			},
			error    : function () {
				malert("服务器开小差了～");
				return "";
			}
		});
    });

</script>
{/block}